<template>
    <div>
        <van-nav-bar title="确定订单" left-text="返回" left-arrow @click-left="()=>{$router.push('/gwc')}" />

          <van-skeleton title :row="3"  v-show=""/>

          <van-contact-card type="edit" :name="address":tel="tel"   @click="onEdit" />
 

<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
/>

<!-- 优惠券单元格 -->
<van-coupon-cell
  :coupons="coupons"
  :chosen-coupon="chosenCoupon"
  @click="showList = true"
/>
<!-- 优惠券列表 -->
<van-popup
  v-model:show="showList"
  round
  position="bottom"
  style="height: 90%; padding-top: 4px;"
>
  <van-coupon-list
    :coupons="coupons"
    :chosen-coupon="chosenCoupon"
    :disabled-coupons="disabledCoupons"
    @change="onChange"
    @exchange="onExchange"
  />
</van-popup>

<van-submit-bar :price="3050" button-text="在线支付" @submit="onSubmit" />

    </div>
</template>

<script setup>
import { ref } from 'vue';
import { showToast } from 'vant';
 const tel = ref('张三   13000000000');
    const address = ref('浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室');
  const activeNames = ref(['1']);
 const coupon = {
      available: 1,
      condition: '无门槛\n最多优惠12元',
      reason: '',
      value: 150,
      name: '优惠券名称',
      startAt: 1489104000,
      endAt: 1514592000,
      valueDesc: '1.5',
      unitDesc: '元',
    };
     const coupon1 = {
      available: 1,
      condition: '无门槛\n最多优惠12元',
      reason: '',
      value: 150,
      name: '优惠券名称',
      startAt: 1489104000,
      endAt: 1514592000,
      valueDesc: '1.5',
      unitDesc: '元',
    };
       const coupons = ref([coupon1,coupon1]);
    const showList = ref(false);
    const chosenCoupon = ref(-1);

    const onChange = (index) => {
      showList.value = false;
      chosenCoupon.value = index;
    };
    const onExchange = (code) => {
      coupons.value.push(coupon);
    };
</script>

<style lang="scss" scoped>

</style>